<template>
  <div class="talent_cultivation">
    <div class="talent_cultivation_breadcrumb">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item>当前位置</el-breadcrumb-item>
        <el-breadcrumb-item>首页</el-breadcrumb-item>
        <el-breadcrumb-item>人才培养</el-breadcrumb-item>
        <el-breadcrumb-item>{{ routerName }}</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="talent_cultivation_section">
      <div class="talent_cultivation_list">
        <div class="children_first">{{ jsondata.label }}</div>
        <div
          :class="
            routerName === item.label ? 'is_children_list' : 'children_list'
          "
          @click="handleClick(item)"
          v-for="(item, index) in jsondata.children"
          :key="index"
        >
          {{ item.label }}
        </div>
      </div>
      <div class="roter_view">
        <router-view></router-view>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "index",
  data() {
    return {
      routerName: "",
      jsondata: {
        label: "人才培养",
        children: [
          {
            label: "人才培养方案",
            url: "/talentCultivation/scheme",
          },
          {
            label: "教员队伍建设",
            url: "/talentCultivation/teacher",
          },
          {
            label: "教学改革",
            url: "/talentCultivation/reformation",
          },
          {
            label: "教学成果",
            url: "/talentCultivation/result",
          },
        ],
      },
    };
  },
  created() {
    this.routerName = this.$route.query.routerName;
  },
  methods: {
    handleClick(val) {
      this.routerName = val.label;
      this.$router.push({
        path: val.url,
        query: {
          routerName: val.label,
        },
      });
    },
  },
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.talent_cultivation {
  width: 1280px;
  margin: 0 auto;

  .talent_cultivation_breadcrumb {
    padding: 20px;
    padding-left: 0;
  }

  .talent_cultivation_section {
    display: flex;
    justify-content: space-between;

    .talent_cultivation_list {
      border: 1px solid #f1f1f1;
      height: 283px;
      text-align: center;
      font-weight: bold;

      .children_first {
        width: 200px;
        height: 56px;
        line-height: 56px;
        background: #f1f1f1;
        color: #0a7b19;
      }

      .children_list {
        width: 200px;
        height: 56px;
        line-height: 56px;
        background: #ffffff;
        border-bottom: 1px solid #f1f1f1;
        cursor: pointer;
        &:hover {
          color: #0a7b19;
          background: #f4fff6;
        }
      }
      .is_children_list {
        width: 200px;
        height: 56px;
        line-height: 56px;
        color: #0a7b19;
        background: #f4fff6;
        border-bottom: 1px solid #f1f1f1;
        cursor: pointer;
      }
    }
  }

  .roter_view {
    width: 1060px;
    min-height: 800px;
  }
}
</style>
